RtTraceEvent

RtTraceEvent allows the user to add trace event calls to an application.

Syntax

BOOL RtTraceEvent(
    ULONG TraceEventID, 
    PVOID arg1,
    PVOID arg2);

Parameters

TraceEventID

A user defined event ID. Valid values are 1 to 1000.

art1, arg2

User defined arguments.

Return Values

TRUE if the function succeeds, FALSE if the function fails

To get extended error information, call GetLastError.

Remarks

User events can be used as triggers and can be captured into log files. User events are created when you add trace event calls into your application using the RTX function call RtTraceEvent.

Requirements

Header Rtapi.h
Library Rtxtcpip.lib

Example

User events are created when you add trace event calls into your application code using the RTX function call RtTraceEvent. You can create user events with event ID numbers 1 to 1000. The following is an example of how to use RtTraceEvent in your application program.

#include "windows.h"
#include "rtapi.h"
void
main(void)
{
     HANDLE hThread;
     BOOL bValue;
     int priority;
     hThread GetCurrentThread();
     priority = RtGetThreadPriority(hThread);
     bValue = RtTraceEvent(1,  /* UserEventID = 1 */
     (PVOID)hThread, (PVOID)priority);
}
IntervalZero.com | Support | Give Feedback